//
//  UIButton+setbutton.m
//  DesighBook
//
//  Created by 梅明 on 15/9/17.
//  Copyright (c) 2015年 梅明. All rights reserved.
//

#import "UIButton+setbutton.h"

@implementation UIButton (setbutton)

+ (instancetype)buttonWithTitle:(NSString *)title AndFrame:(CGRect)frame{
    UIButton *button = [[UIButton alloc]initWithFrame:frame];
    [button setTitle:title forState:UIControlStateNormal];
    [button setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    [button setTitleColor:[UIColor redColor] forState:UIControlStateSelected];
    [button setBackgroundColor:[UIColor whiteColor]];
    button.layer.borderWidth = 0.5f;
    button.layer.borderColor = [[UIColor groupTableViewBackgroundColor]CGColor];
    button.titleLabel.font = [UIFont systemFontOfSize:12];
    [button setImage:[UIImage imageNamed:@"ico_city_drop_downarrow_on.png"] forState:UIControlStateNormal];
    [button setImage:[UIImage imageNamed:@"ico_city_drop_uparrow_on.png"] forState:UIControlStateSelected];
    //UIEdgeInsetsMake(<#CGFloat top#>, <#CGFloat left#>, <#CGFloat bottom#>, <#CGFloat right#>)
    button.imageEdgeInsets = UIEdgeInsetsMake(0, 90, 0, 0);
    button.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 40);
    
    return button;
}


@end
